# 原型模式
from copy import deepcopy

class Prototype:
    def __init__(self, name):
        self.name = name
    def clone(self):
        return deepcopy(self)

if __name__ == "__main__":
    prototype = Prototype("prototype")
    clone = prototype.clone()
    clone.name = "clone"
    print(prototype.name)   
    print(clone.name)   

    clone2 = prototype.clone()
    clone2.name = "clone2"
    print(clone2.name)   
    

    

    # output: prototype